import "@antv/x6-vue-shape";
import tabCom from "../component/subComponents/tab-com.vue";
import boardcastCom from "../component/subComponents/boardcast-com.vue";
import cityCom from "../component/subComponents/badge-com.vue";

const comList = {
  tabCom: tabCom,
  boardcastCom: boardcastCom,
  cityCom: cityCom
};
export const tabNode = type => {
  return {
    inherit: "vue-shape",
    x: 200,
    y: 150,
    width: 150,
    height: 100,
    component: comList[type],
    label: type,
    ports: {
      items: [
        { group: "in", id: "p_top" },
        { group: "right-out", id: "p_right" },
        { group: "bottom-out", id: "p_bottom" },
        { group: "left-out", id: "p_left" }
      ],
      groups: {
        in: {
          position: "top",
          zIndex: 20,
          attrs: {
            circle: {
              r: 4,
              magnet: true,
              stroke: "#31d0c6",
              strokeWidth: 2,
              fill: "#fff"
            }
          }
        },
        "bottom-out": {
          position: "bottom",
          zIndex: 20,
          attrs: {
            circle: {
              r: 4,
              magnet: true,
              stroke: "#31d0c6",
              strokeWidth: 2,
              fill: "#fff"
            }
          }
        },
        "right-out": {
          position: "right",
          zIndex: 20,
          attrs: {
            circle: {
              r: 4,
              magnet: true,
              stroke: "#31d0c6",
              strokeWidth: 2,
              fill: "#fff"
            }
          }
        },
        "left-out": {
          position: "left",
          zIndex: 20,
          attrs: {
            circle: {
              r: 4,
              magnet: true,
              stroke: "#31d0c6",
              strokeWidth: 2,
              fill: "#fff"
            }
          }
        }
      }
    }
  };
};
